export type ComponentType =
  | "input"
  | "input-number"
  | "select"
  | "tree-select"
  | "cascader"
  | "date-picker"
  | "time-picker"
  | "time-select"
  | "switch"
  | "custom"

export type OptionsProps = {
  label: string;
  value: number | string;
  disabled?: boolean;
  children?: OptionsProps[];
};

export type FormSchema = {
  valueType?: ComponentType;
  label?: string;
  prop: string;
  placeholder?: string;
  // 枚举类型（字典）
  options?: OptionsProps[];
  // 组件属性，根据 element plus 官方文档来传
  fieldProps?: any;
  // 组件事件 element plus 官方文档来传递
  on?: {
    [key: string]: (value?: any) => any;
  };
  // 默认值
  defaultValue?: string | number | boolean | any[];
  // 检验规则
  rules?: any[];
  // el-form-item属性，根据 element plus 官方文档来传递，该属性所有值会透传到组件递
  formItemProps?: any;
  // 占用列数
  itemSpan?: number;
  // 排序
  order?: number;
  hidden?: boolean;
};
